home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************
- *** SafariSprite.c
- *** By: Stefan C. Sinclair
- *** Copyright © 1996 All Rights Reserved Worldwide.
- *** Guy Farrari's Background sprite control routines
- *******************************************************/
-
- #include "SpriteBackground.h"
-
- extern CWindowPtr gWindowP;
- extern short gFrameAdvanceTime;
- extern RgnHandle gWorkRgn;
-
-
- void SetupSafariSprite(SpritePtr spriteP)
- {
- Rect tempBoundsRect, moveBoundsRect;
- short horizMoveDelta;
- short vertMoveDelta;
-
- moveBoundsRect = gWindowP->portRect;
- tempBoundsRect = moveBoundsRect;
- horizMoveDelta = 0; //GetRandom(2, 6);
- vertMoveDelta = 0; //GetRandom(2, 6);
-
- // calculate the movement boundary rectangle
- InsetRect(&tempBoundsRect, horizMoveDelta, vertMoveDelta);
-
- // set the sprite’s movement characteristics
- SWSetSpriteMoveBounds(spriteP, &tempBoundsRect);
- SWSetSpriteMoveDelta(spriteP, horizMoveDelta, vertMoveDelta);
- SWSetSpriteMoveProc(spriteP, SafariMoveProc); //• mine
- // Maximum Speed!!!
- SWSetSpriteMoveTime(spriteP, 0); // Stationary
- SWSetSpriteFrameTime(spriteP, 5*5*(20-gFrameAdvanceTime-1)); // 1/5 speed
- SWSetSpriteFrameRange(spriteP, 0, 12); // 13 frames
- SWSetSpriteFrameAdvance(spriteP, 1);
- // Default draw proc = CopyBits
- SWSetSpriteCollideProc(spriteP, SafariSpriteCollideProc); // mine
- // set the sprite’s initial location
- SWSetSpriteLocation(spriteP, 240, (moveBoundsRect.bottom - 200));
- }
-
- // SafariSpriteCollideProc----------------------------------------------------------------
- void SafariSpriteCollideProc(SpritePtr srcSpriteP,SpritePtr dstSpriteP,Rect* sectRect)
- {
- return; // bare minimum!
- }
-
- /** SafariMoveProc **/
- // Here, reset sprite frame range as necessary depending on location.
- SW_FUNC void SafariMoveProc(SpritePtr srcSpriteP, Point* spritePoint)
- {
- return; // bare minimum!
- }